package Test1;

public class Q3Mytime {
    private int hour;
    private int minute;
    private int second;

    public Q3Mytime(int x, int y, int z) {
        this.hour = x;
        this.minute = y;
        this.second = z;
    }

    public void diaplay() {
        System.out.println("the time is " + this.hour + ":" + this.minute + ":" + this.second);
    }

    public void assHour(int hou) {
        this.hour = this.hour + hou;
    }

    public void addSecond(int sec) {
        this.second = this.second + sec;
    }

    public void addMinute(int min) {
        this.minute = this.minute + min;
    }

    public void subHour(int hou) {
        this.hour = this.hour - hou;
    }

    public void subSecond(int sec) {
        this.second = this.second - sec;
    }

    public void subMinute(int min){
        this.minute=this.minute-min;
    }
}
